#ifndef QHTTPSERIALIZE_H
#define QHTTPSERIALIZE_H

#include "QHttpContentType.h"

// text/plain QString
QHTTPCONTENTTYPE_BEGIN_DECLARE_CLASS(QString)
static void fromByteArray(QString &str, const QByteArray &bstr)
{
    str = QString::fromStdString(bstr.toStdString());
}
static void toByteArray(const QString &str, QByteArray &bstr)
{
    bstr = QByteArray::fromStdString(str.toStdString());
}
QHTTPCONTENTTYPE_END_DECLARE_CLASS

// text/plain QByteArray
QHTTPCONTENTTYPE_BEGIN_DECLARE_CLASS(QByteArray)
static void fromByteArray(QByteArray &b1, const QByteArray &b2)
{
    b1 = b2;
}
static void toByteArray(const QByteArray &b1, QByteArray &b2)
{
    b2 = b1;
}
QHTTPCONTENTTYPE_END_DECLARE_CLASS

#endif // QHTTPSERIALIZE_H
